package org.john.gson;

import com.google.gson.Gson;

import java.util.HashMap;

/**
 * Created by adsame on 17-3-22.
 */
public class GsonTest {

    public static void main(String a[]) {
        HashMap<String, String> map = new HashMap();
        map.put("idfa", "difoew");
        map.put("imei", "32794729");
        map.put("androidId", "fjeiowi");
        map.put("mac", "ba:ei:ei:sd");
        map.put("macMd5", "");
        Gson gson = new Gson();
        String str = gson.toJson(map);
        System.out.println(str);
//        str += "invalid";
        System.out.println(gson.fromJson(str, HashMap.class));
        System.out.println("end");
    }
}
